package cn.org.xwb.bookmall.model.properties;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "redis")
@AllArgsConstructor
@NoArgsConstructor
@Data
public class RedisProp {

    /**
     * 用户相关的 redis key 前缀
     */
    private String keyPrefixUser;

    public String getRedisKeyUser(String keyAppend) {
        return keyPrefixUser + keyAppend;
    }

    /**
     * 管理员相关的 redis key 前缀
     */
    private String keyPrefixAdmin;

    public String getRedisKeyAdmin(String keyAppend) {
        return keyPrefixAdmin + keyAppend;
    }

}
